package com.springboot.file.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.springboot.file.converter.BorrowLoanFlagConverter;
import com.springboot.file.converter.NeedPayAccStatusConvertor;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@TableName("cust_credit_info")
@ApiModel("客户挂账信息表")
public class CustCreditInfo {

    /**
     * 挂账状态：01-未锁定
     */
    public static final String ORDER_STATUS_01 = "01";
    /**
     * 挂账状态：02-已锁定
     */
    public static final String ORDER_STATUS_02 = "02";
    /**
     * 挂账状态：03-不可用（支用成功）
     */
    public static final String ORDER_STATUS_03 = "03";

    @TableId("charge_order_no")
    @ApiModelProperty("挂账单据编号")
    @ExcelIgnore
    private String chargeOrderNo;

    @TableField("order_no")
    @ApiModelProperty(value = "采购订单编号")
    @ExcelProperty(value = "采购订单编号", index = 0)
    private String orderNo;

    @TableField("need_pay_acc_evidence_code")
    @ApiModelProperty(value = "应付账款凭证编号")
    @ExcelProperty(value = "应付账款凭证编号", index = 1)
    private String needPayAccEvidenceCode;

    @TableField("need_pay_acc_project")
    @ApiModelProperty(value = "应付账款行项目")
    @ExcelProperty(value = "应付账款行项目", index = 2)
    private String needPayAccProject;

    @TableField("invoice_project")
    @ApiModelProperty(value = "发票行项目")
    @ExcelProperty(value = "发票行项目", index = 3)
    private String invoiceProject;

    @TableField("clear_account_evidence")
    @ApiModelProperty(value = "清账凭证")
    @ExcelProperty(value = "清账凭证", index = 4)
    private String clearAccountEvidence;

    @TableField("refer_evidence")
    @ApiModelProperty(value = "参考凭证")
    @ExcelProperty(value = "参考凭证", index = 5)
    private String referEvidence;

    @TableField("pay_company_mdg_code")
    @ApiModelProperty(value = "付款公司MDG编码")
    @ExcelProperty(value = "付款公司MDG编码", index = 6)
    private String payCompanyMdgCode;

    @TableField("pay_company_name")
    @ApiModelProperty(value = "付款公司名称")
    @ExcelProperty(value = "付款公司名称", index = 7)
    private String payCompanyName;

    @TableField("receive_company_mdg_code")
    @ApiModelProperty(value = "收款公司MDG编码")
    @ExcelProperty(value = "收款公司MDG编码", index = 8)
    private String receiveCompanyMdgCode;

    @TableField("receive_company_name")
    @ApiModelProperty(value = "收款公司名称")
    @ExcelProperty(value = "收款公司名称", index = 9)
    private String receiveCompanyName;

    @TableField("need_pay_acc_amount")
    @ApiModelProperty(value = "应付账款金额")
    @ExcelProperty(value = "应付账款金额", index = 10)
    private BigDecimal needPayAccAmount;

    @TableField("total_amount")
    @ApiModelProperty(value = "总金额")
    @ExcelProperty(value = "总金额", index = 11)
    private BigDecimal totalAmount;

    @TableField("paid_amount")
    @ApiModelProperty(value = "已付金额")
    @ExcelProperty(value = "已付金额", index = 12)
    private BigDecimal paidAmount;

    @TableField("remaining_amount")
    @ApiModelProperty(value = "剩余金额")
    @ExcelProperty(value = "剩余金额", index = 13)
    private BigDecimal remainingAmount;

    @TableField("receivable_amount")
    @ApiModelProperty(value = "应收备注")
    @ExcelProperty(value = "应收备注", index = 14)
    private String receivableAmount;

    @TableField("cd_no")
    @ApiModelProperty(value = "借贷标识")
    @ExcelProperty(index = 15,value = "借贷标识",converter = BorrowLoanFlagConverter.class)
    private String cdNo;

    @TableField("need_pay_acc_status")
    @ApiModelProperty(value = "应付账款状态")
    @ExcelProperty(value = "应付账款状态", index = 16,converter = NeedPayAccStatusConvertor.class)
    private String needPayAccStatus;

    @TableField("evidence_date")
    @ApiModelProperty(value = "凭证日期")
    @ExcelProperty(value = "凭证日期", index = 17)
    private String evidenceDate;

    @TableField("clear_account_date")
    @ApiModelProperty(value = "清账日期")
    @ExcelProperty(value = "清账日期", index = 18)
    private String clearAccountDate;

    @TableField("plan_receive_date")
    @ApiModelProperty(value = "计划收款日期")
    @ExcelProperty(value = "计划收款日期", index = 19)
    private String planReceiveDate;

    @TableField("receive_date")
    @ApiModelProperty(value = "实际收款日期")
    @ExcelProperty(value = "实际收款日期", index = 20)
    private String receiveDate;

    @TableField("this_pay_contract_name")
    @ApiModelProperty(value = "本笔付款对应合同名称")
    @ExcelProperty(value = "本笔付款对应合同名称", index = 21)
    private String thisPayContractName;

    @TableField("this_pay_contract_no")
    @ApiModelProperty(value = "本笔付款对应合同编号")
    @ExcelProperty(value = "本笔付款对应合同编号", index = 22)
    private String thisPayContractNo;

    @TableField("contract_year")
    @ApiModelProperty(value = "合同所属自然年")
    @ExcelProperty(value = "合同所属自然年", index = 23)
    private String contractYear;

    @TableField("contract_file_url")
    @ApiModelProperty(value = "合同文件路径")
    private String contractFileUrl;

    @TableField("invoice_file_url")
    @ApiModelProperty(value = "发票文件路径")
    private String invoiceFileUrl;

    @TableField("order_audit_status")
    @ApiModelProperty("订单审核状态:01-审核中,02-审核通过,03-审核拒绝")
    @ExcelIgnore
    private String orderAuditStatus;

    @TableField("create_user")
    @ApiModelProperty("创建用户")
    @ExcelIgnore
    private String createUser;

    @TableField("last_update_user")
    @ApiModelProperty("最新更新用户")
    @ExcelIgnore
    private String lastUpdateUser;

    @TableField(value = "create_datetime", fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    @ExcelIgnore
    private LocalDateTime createDatetime;

    @TableField(value = "last_update_datetime", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty("最新更新时间")
    @ExcelIgnore
    private LocalDateTime lastUpdateDatetime;

    @TableField(exist = false)
    @ApiModelProperty("发票号码")
    @ExcelIgnore
    private String invoiceNumber;
}